home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1994 / MacHack 1994.toast / MacHack™ 1987-1994 / MacHack™ '92 / Hacks ’92 / FinderMenu ƒ / FinderMenu 1.0 / Extras / DocServer Source Text next >
Encoding:
Text File  |  1992-06-15  |  5.7 KB  |  75 lines  |  [TEXT/ttxt]

  1.  
  2. Verb    file.reconcileFolder
  3. Syntax    file.reconcileFolder (original, clone, copyFilter)
  4. Parameters    original is the full path to a folder or alias of a folder.
  5. clone is the full path to a folder or alias of a folder.
  6. copyFilter is the address of a Frontier script.
  7. Action    Updates the clone folder so that it contains all the files in the original folder.
  8. Two passes are made. First the clone folder is traversed to see if it's missing any files in the original. Any missing files are copied into the clone.
  9. Any files or sub-folders that were modified more recently than the files in the clone are also copied.
  10. In the second pass, the clone folder is traversed to see if it contains any files or sub-folders that don't exist in the original. Those files are moved to the "Extra Files" sub-folder in the clone, which is created if it doesn't already exist.
  11. The copyFilter callback routine is passed to file.filteredCopy, allowing you to override any copying, or to create a report of any files that were copied. See the docs for file.filteredCopy for details.
  12. Returns    True.
  13. Examples    file.reconcileFolder ("System:Source:", "System:Dest:", @msg)
  14.     « true «after it's done, Dest will contain all the files in Source
  15. Notes    This capability is important for any user with more than one Macintosh, especially PowerBook users.
  16. file.reconcileFolder is implemented as a Frontier script, so you can examine the source code to see how it works.
  17. This verb is used in the FinderMenu package to implement the "Reconcile Folders" command. It's provided separately so that script writers can easily write custom scripts that reconcile specific pairs of folders.
  18. See Also    file.filteredCopy
  19.  
  20. Verb    dialog.loadFromFile
  21. Syntax    dialog.loadFromFile (path)
  22. Parameters    path is the full path to a file that contains a DLOG resource with ID = 25000, and a DITL resource with the same ID.
  23. Action    Copies the DLOG and DITL into the resource fork of Frontier.root.
  24. Returns    The resource ID in Frontier.root's resource fork assigned to the DLOG/DITL.
  25. Examples    dialog.run (dialog.loadFromFile ("System:Fun Dialog"), 1, @itemHitCallback)
  26.     « true
  27. Notes    If the file doesn't exist, dialog.loadFromFile checks in the Dialogs folder in your Frontier folder. If it exists there, it's loaded.
  28. If you're publishing a script that uses a dialog run from the Dialogs folder, we ask that you append your initials to the end of the file name to help eliminate conflicting names.
  29. Use this verb when a dialog may run several times from within a single script. Never depend on your dialog being loaded from run to run. If a dialog can only run once within a script, use dialog.runFromFile because it is simpler.
  30. dialog.loadFromFile is implemented as a Frontier script, so you can examine the source code to see how it works.
  31. See Also    dialog.run
  32. dialog.runModeless
  33. dialog.runFromFile
  34.  
  35. Verb    dialog.runFromFile
  36. Syntax    dialog.runFromFile (path, defaultItem, itemHitCallback)
  37. Parameters    path is the full path to a file that contains a DLOG resource with ID = 25000, and a DITL resource with the same ID.
  38. defaultItem is the item number of the item that is displayed in bold, and is selected when the user presses the Return or Enter key.
  39. itemHitCallback is the address of a script to be executed when an item in the dialog is hit and the user's action must be processed.
  40. Action    Calls dialog.loadFromFile to load the dialog from a file, then dialog.run to run the dialog.
  41. Returns    The value returned by dialog.run.
  42. Examples    dialog.runFromFile ("System:Fun Dialog", 1, @itemHitCallback)
  43.     « true
  44. Notes    See the documentation for dialog.run and dialog.loadFromFile for full information.
  45. Use this verb when a dialog appears only once in a script. Use dialog.loadFromFile if it may appear several times.
  46. dialog.runFromFile is implemented as a Frontier script, so you can examine the source code to see how it works.
  47. See Also    dialog.run
  48. dialog.loadFromFile
  49.  
  50. Verb    menu.addMenuCommand
  51. Syntax    menu.addMenuCommand (adrMenubar, menuName, itemString, scriptString)
  52. Parameters    adrMenubar is the address of a menubar object in Frontier.root.
  53. menuName is the name of a menu contained within the menu bar.
  54. itemString is the name of the command which you wish to add to the menu.
  55. scriptString is the text of the script to be executed when the command is selected.
  56. Action    Adds a command to the menubar object.
  57. Returns    True.
  58. Examples    menu.addMenuCommand (@system.misc.menubar, "Custom", "Hello", "dialog.alert (user.name)")
  59.     « true «adds a command named Hello to the end of your Custom menu
  60. menu.addMenuCommand (@system.menubars.[FinderMenu.id], "System 7", "Hello", "dialog.alert (user.name)")
  61.     « true «you can add commands to sub-menus too
  62. Notes    menu.addMenuCommand is implemented as a Frontier script, so you can examine the source code to see how it works.
  63. See Also    menu.setScript
  64.  
  65. Verb    FinderMenu.visitPaths
  66. Syntax    FinderMenu.visitPaths (adrCallback)
  67. Parameters    adrCallback is the address of a Frontier script that will be called once for each item selected in the Finder.
  68. Action    Calls the callback script once for each item selected in the Finder.
  69. Returns    True if all the callbacks returned true, false if it wasn't able to connect with the FinderMenu app, or if the callback returned false.
  70. Examples    FinderMenu.visitPaths (@msg)
  71.     « true «display each path in the main window in Frontier
  72. Notes    The callback routine must accept exactly one parameter, the full path to the file, folder or disk that's to be processed by the script.
  73. If the callback returns true processing continues. If it returns false, FinderMenu.visitPaths returns false immediately without processing any other files. Use this capability, for example, when you're searching for something, and you found it.
  74. FinderMenu.visitPaths is implemented as a Frontier script, so you can examine the source code to see how it works.
  75.